home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / MoreTV.vbs < prev    next >
Encoding:
Text File  |  2004-09-09  |  4.4 KB  |  179 lines

  1. 'FMA Script Framework Plugin
  2. 'MoreTV
  3. 'Lets you control MoreTV
  4.  
  5. 'TODO:
  6. '-Testing
  7.  
  8. Class MoreTV
  9.     
  10.     Private m_Self
  11.     Private mainMenu
  12.     Private tvRemoteMenu
  13.     
  14.     'Some info about the plugin
  15.     Public Property Get SHOWABLE 'Do I have a menu?
  16.         SHOWABLE    = True
  17.     End Property
  18.     Public Property Get TITLE 'What's my name?
  19.         TITLE       = "MoreTV"
  20.     End Property
  21.     Public Property Get DESCRIPTION 'What's my purpose?
  22.         DESCRIPTION = "Lets you control MoreTV"
  23.     End Property
  24.     Public Property Get AUTHOR 'Who created me?
  25.         AUTHOR      = "streawkceur (inspired by CarpeDi3m)"
  26.     End Property
  27.     Public Property Get URL 'Were can I be found? Where can you get more information?
  28.         URL = "http://fma.xinium.com/"
  29.     End Property
  30.     
  31.     'Who am I?
  32.     Public Property Let Self (s)
  33.         m_Self = s
  34.         ' Some init stuff here:
  35.         If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "MoreTV"
  36.         If IsEmpty(Settings(Me, "Exe"))   or Settings(Me, "Exe")   = "" Then Settings(Me, "Exe")   = "C:\Program Files\MoreTV\MoreTV.exe"
  37.         
  38.         'MainMenu items will be put every time Show() is called
  39.         Set mainMenu = New ManagedMenu
  40.         
  41.         'RatingMenu items are static. We can initialize them once
  42.         Set tvRemoteMenu = New ManagedMenu
  43.         Dim tempList, bi
  44.         Set tempList = New LinkedList
  45.         bi = tempList.BackInserter
  46.         bi.Item = Array("Button 1", s & ".Button1")
  47.         bi.Item = Array("Button 2", s & ".Button2")
  48.         bi.Item = Array("Button 3", s & ".Button3")
  49.         bi.Item = Array("Button 4", s & ".Button4")
  50.         bi.Item = Array("Button 5", s & ".Button5")
  51.         bi.Item = Array("Button 6", s & ".Button6")
  52.         bi.Item = Array("Button 7", s & ".Button7")
  53.         bi.Item = Array("Button 8", s & ".Button8")
  54.         bi.Item = Array("Button 9", s & ".Button9")
  55.         bi.Item = Array("Button 0", s & ".Button0")
  56.         tvRemoteMenu.SetList tempList
  57.         tvRemoteMenu.Title = "MoreTV - Remote"
  58.     End Property
  59.     Public Property Get Self
  60.         Self = m_Self
  61.     End Property
  62.     
  63.     'Display me. Eventually put a menu on the screen
  64.     Sub Show()
  65.         '--> Init Menu
  66.         Set llist = New LinkedList
  67.         Dim bi
  68.         bi = llist.BackInserter
  69.         If MoreTVOpen Then
  70.             bi.Item = Array("Remote Mode",  Self & ".TVList")
  71.             bi.Item = Array("Channel Up",   Self & ".ChannelUp")
  72.             bi.Item = Array("Channel Down", Self & ".ChannelDown")
  73.             bi.Item = Array("(Un)Mute",     Self & ".Mute")
  74.             bi.Item = Array("Fullscreen",   Self & ".Fullscreen")
  75.             bi.Item = Array("Videotext",    Self & ".Videotext")
  76.             bi.Item = Array("Close",        Self & ".Close")
  77.         Else
  78.             bi.Item = Array("Launch",       Self & ".Launch")
  79.         End If
  80.         mainMenu.SetList llist
  81.         mainMenu.Title = TITLE
  82.         mainMenu.ShowMenu
  83.     End Sub
  84.     
  85.     Function MoreTVOpen
  86.         MoreTVOpen = Shell.AppActivate(Settings(Me, "Title"))
  87.     End Function
  88.     
  89.     Sub Launch
  90.         If Fso.FileExists(Settings(Me, "Exe")) Then
  91.             Shell.Exec Settings(Me, "Exe")
  92.             Util.WaitForAppLoad Settings(Me, "Title"), 10000 'Give MoreTV max. 10 secs to load
  93.         Else
  94.             Debug.DebugMsg Self & " - Launch: File not found: " & Settings(Me, "Exe")
  95.         End If
  96.         Show
  97.     End Sub
  98.     
  99.     Sub Close
  100.         If MoreTVOpen Then
  101.             Shell.SendKeys "{F10}"
  102.             Util.Sleep 3000 'Give MoreTV 3secs to close itself
  103.         End If
  104.         Show
  105.     End Sub
  106.     
  107.     Sub TVList
  108.         tvRemoteMenu.ShowMenu
  109.     End Sub
  110.     
  111.     Sub Button1
  112.         If MoreTVOpen Then     Shell.SendKeys 1
  113.         am.Update
  114.     End Sub
  115.     Sub Button2
  116.         If MoreTVOpen Then     Shell.SendKeys 2
  117.         am.Update
  118.     End Sub
  119.     Sub Button3
  120.         If MoreTVOpen Then     Shell.SendKeys 3
  121.         am.Update
  122.     End Sub
  123.     Sub Button4
  124.         If MoreTVOpen Then     Shell.SendKeys 4
  125.         am.Update
  126.     End Sub
  127.     Sub Button5
  128.         If MoreTVOpen Then     Shell.SendKeys 5
  129.         am.Update
  130.     End Sub
  131.     Sub Button6
  132.         If MoreTVOpen Then     Shell.SendKeys 6
  133.         am.Update
  134.     End Sub
  135.     Sub Button7
  136.         If MoreTVOpen Then     Shell.SendKeys 7
  137.         am.Update
  138.     End Sub
  139.     Sub Button8
  140.         If MoreTVOpen Then     Shell.SendKeys 8
  141.         am.Update
  142.     End Sub
  143.     Sub Button9
  144.         If MoreTVOpen Then     Shell.SendKeys 9
  145.         am.Update
  146.     End Sub
  147.     Sub Button0
  148.         If MoreTVOpen Then     Shell.SendKeys 0
  149.         am.Update
  150.     End Sub
  151.     
  152.     Sub ChannelUp
  153.         If MoreTVOpen Then Shell.SendKeys "{UP}"
  154.         am.Update
  155.     End Sub
  156.     
  157.     Sub ChannelDown
  158.         If MoreTVOpen Then Shell.SendKeys "{DOWN}"
  159.         am.Update
  160.     End Sub
  161.     
  162.     Sub Mute
  163.         If MoreTVOpen Then Shell.SendKeys "m"
  164.         am.Update
  165.     End Sub
  166.     
  167.     Sub Fullscreen
  168.         If MoreTVOpen Then Shell.SendKeys "{F9}"
  169.         am.Update
  170.     End Sub
  171.     
  172.     Sub Videotext
  173.         If MoreTVOpen Then Shell.SendKeys "v"
  174.         am.Update
  175.     End Sub
  176.  
  177. End Class
  178.  
  179.